package com.luomo.wenyuan.modules.wenyuan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luomo.wenyuan.common.utils.PageUtils;
import com.luomo.wenyuan.modules.wenyuan.dao.TPutawayBookDao;
import com.luomo.wenyuan.modules.wenyuan.entity.TPutawayBookEntity;
import com.luomo.wenyuan.modules.wenyuan.service.TPutawayBookService;
import com.luomo.wenyuan.common.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("tPutawayBookService")
public class TPutawayBookServiceImpl extends ServiceImpl<TPutawayBookDao, TPutawayBookEntity> implements TPutawayBookService {

    @Autowired
    private TPutawayBookDao tPutawayBookDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TPutawayBookEntity> page = this.page(
                new Query<TPutawayBookEntity>().getPage(params),
                new QueryWrapper<TPutawayBookEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<TPutawayBookEntity> getByPutawayId(int putawayId) {
        return tPutawayBookDao.getByPutawayId(putawayId);
    }

}